import React, { Component } from "react";
import { connect } from "react-redux";
import MainLayout from "../../../../component/mainLayout/mainLayout";
import "./WithdrawSuccess.scss";

class WithdrawSuccess extends Component {
	constructor(props) {
		super(props);
		this.state = {};
	}

	componentDidMount() {}

	render() {
		const headerParams = {
			header: {
				title: "提现结果"
			},
			history: this.props.history,
			cacheLifecycles: this.props.cacheLifecycles,
			loadStatus: this.state.loadStatus // （ '0'：数据加载中，'1'：加载完成，'2'：加载失败）
		};
		return (
			<MainLayout pageParams={headerParams}>
				<div className="withdrow-success-page">
					<div className="top-content">
						<img
							className="top-img"
							src={require("../../../../images/icon/ok.png")}
						/>
						<div className="tips">提现成功</div>
						<div className="line-2">
							<div className="item">
								<div className="item-top">提现金额</div>
								<div className="item-bottom">¥1,000.00</div>
							</div>
							<div className="item">
								<div className="item-top">剩余余额</div>
								<div className="item-bottom">¥41,000.00</div>
							</div>
						</div>
						<div className="t-type">
							<div className="t-left">付款方式</div>
							<div className="t-right">中国银行储蓄卡（1311）</div>
						</div>
					</div>
					<div className="line-3">
						<div className="item t-b" onClick={this.gotoNext.bind(this, 1)}>
							回到首页
						</div>
						{/*<div className="item t-w" onClick={this.gotoNext.bind(this, 2)}>继续完成支付</div>*/}
					</div>
				</div>
			</MainLayout>
		);
	}

	gotoNext(i) {
		if (i === 1) {
			//转出
			this.props.history.push({
				pathname: `/walletHome`
			});
		} else if (i === 2) {
			//转入
			// this.props.history.push({
			//     pathname: `/transferXHBInto`,
			//     params: {}
			// });
		}
	}
}

function mapStateToProps(state) {
	return state;
}

function mapDispatchToProps() {
	return {};
}

export default connect(mapStateToProps, mapDispatchToProps)(WithdrawSuccess);
